package com.example.parking.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.ui.Model;

@Controller
public class ViewController {

    @GetMapping("/")
    public String index() {
        return "redirect:/parking-lot";
    }

    @GetMapping("/parking-lot")
    public String parkingLot(Model model) {
        model.addAttribute("contentView", "parking-lot/list");
        model.addAttribute("activePage", "lot");
        return "layout";
    }

    @GetMapping("/parking-space")
    public String parkingSpace(Model model) {
        model.addAttribute("contentView", "parking-space/list");
        model.addAttribute("activePage", "space");
        return "layout";
    }

    @GetMapping("/vehicle")
    public String vehicle(Model model) {
        model.addAttribute("contentView", "vehicle/list");
        model.addAttribute("activePage", "vehicle");
        return "layout";
    }

    @GetMapping("/parking-record")
    public String parkingRecord(Model model) {
        model.addAttribute("contentView", "parking-record/list");
        model.addAttribute("activePage", "record");
        return "layout";
    }

    @GetMapping("/user")
    public String user(Model model) {
        model.addAttribute("contentView", "user/list");
        model.addAttribute("activePage", "user");
        return "layout";
    }

    @GetMapping("/login")
    public String login() {
        return "login";
    }

    @GetMapping("/register")
    public String register() {
        return "register";
    }
} 